//
//  File.swift
//  BCScrollViewKit
//
//  Created by chun.chen on 2019/7/10.
//  公共定义

//MARK: - 图片资源
public func BCScrollViewKitImage(_ name: String, _ frameworkCls:AnyObject?) -> UIImage? {
    if let image = UIImage(named: name) {
        return image
    }
    if let image2 = UIImage(named: "BCScrollViewKit.bundle/"+name) {
        return image2
    }
    guard let _frameworkCls = frameworkCls else {
        return nil
    }
    let bundle = Bundle(for: type(of: _frameworkCls))
    let image = UIImage(named: "BCScrollViewKit.bundle/\(name)", in: bundle, compatibleWith: nil)
    return  image
}

//MARK: - utils
/// scroll view 空数据提示
///
/// - Parameter title: 提示文案
/// - Returns: return value description
public func BCScrollEmptyDataTitle(_ title:String) -> NSAttributedString {
    return NSAttributedString.init(string: title, attributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)])
}

/// scroll view 空数据图片
///
/// - Returns: return value description
public func BCScrollEmptyDataImage() -> UIImage? {
    return UIImage(named: "empty_no_data")
}
